<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    form {
      display: flex;
    }

    input[type="text"]:focus {
      background: pink;
      flex-grow: 1;
    }
  </style>
</head>

<body>
  <form action="">
    <input type="text" placeholder="CSS技巧">
    <input type="submit" value="搜索">
  </form>
</body>

</html>